package com.sinocst.sap;

import com.sinocst.util.PropertiesUtil;

import java.util.Properties;

/**
 * @Project: JavaWebSAPAPI
 * @Author: zhang10092009@hotmail.com
 * @Date: 2018/2/24  14:47
 * @Description:
 */
public class SapConfig {
    /*用户ID*/
    static String SAP_CLIENT_ID;
    /*用户名*/
    static String SAP_CLIENT_USER;
    /*用户密码*/
    static String SAP_CLINET_PASSWORD;
    /*用户语言*/
    static String SAP_CLIENT_LANGUAGE;
    /*用户IP*/
    static String SAP_CLIENT_IP;
    /*系统编号*/
    static String SAP_CLIENT_SYSNR;
    /*系统最大空闲连接数 pool_capacity*/
    static int SAP_CLIENT_POOL_CAPACITY;
    /*超时时间 max_get_client_time*/
    static int SAP_MAX_GET_CLIENT_TIME;
    /*最大活动连接数 peak_limit*/
    static int SAP_PEAK_LIMIT;

    /*设置配置文件的值*/
    static {
        SAP_CLIENT_ID = PropertiesUtil.getProperty("jco.client.client");
        SAP_CLIENT_USER = PropertiesUtil.getProperty("jco.client.user");
        SAP_CLINET_PASSWORD = PropertiesUtil.getProperty("jco.client.passwd");
        SAP_CLIENT_LANGUAGE = PropertiesUtil.getProperty("jco.client.lang");
        SAP_CLIENT_IP = PropertiesUtil.getProperty("jco.client.ashost");
        SAP_CLIENT_SYSNR = PropertiesUtil.getProperty("jco.client.sysnr");
        SAP_CLIENT_POOL_CAPACITY = Integer.valueOf(PropertiesUtil.getProperty("jco.destination.pool_capacity"));
        SAP_MAX_GET_CLIENT_TIME = Integer.valueOf(PropertiesUtil.getProperty("jco.destination.max_get_client_time"));
        SAP_PEAK_LIMIT = Integer.valueOf(PropertiesUtil.getProperty("jco.destination.peak_limit"));
    }
}
